<%--
  Created by IntelliJ IDEA.
  User: Cedar
  Date: 2019/11/29
  Time: 21:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ include file="heder.jsp" %>

<html>
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<style>

    input {
        width: 60%;
        margin: 0 10px;
        padding-left: 5px;
        outline: none;
    }

    label {
        width: 80px;
        display: inline-block;
    }

    form {
        margin: 80px auto;
        width: 350px;
    }

    div {
        margin: 15px 0;
    }

    .msg {
        font-size: 15px;
        color: red;
    }
</style>
<head>
    <title>注册</title>
</head>
<body>
<form name="register" action="user/register" method="post" enctype="multipart/form-data">
    <p style="font-weight: bold;font-size: 25px;text-align: center">请注册</p>
    <div style="margin: 0 auto">
        <p><label>用户名:</label><input id="userName" name="userName" placeholder="请输入用户名" required value="${userName}"></p>
        <p><label>密&nbsp;&nbsp; 码:</label><input id="password" type="password" name="password" placeholder="请输入密码" required value="${password}"></p>
        <p><label>确认密码:</label><input id="passwordConform" type="password" name="passwordConform"></p>
        <p><label>头 像:</label><input name="headImg" type="file" required></p>
        <div style="text-align: center">
            <button type="submit" id="submit">注册</button>
            <div class="msg">${msg}</div>
            <a href="login.jsp"> 登录</a>
        </div>
    </div>
</form>
</body>

<script>
    $(function () {
        $('#submit').click(function () {
            var pass = $("#password").val();
            var passRepeat = $("#passwordConform").val();
            if (pass != passRepeat) {
                alert("两次输入的密码不一致");
                return false;
            }
        });

    });
</script>
</html>
